package com.itheima.myset;

import java.util.TreeSet;

public class TreeSetDemo1 {
    public static void main(String[] args) {
        TreeSet<Student> ts = new TreeSet<>();
        Student s1 = new Student("a",20);
        Student s2 = new Student("b",21);
        Student s3 = new Student("c",22);
        Student s4 = new Student("d",20);
        ts.add(s1);
        ts.add(s2);
        ts.add(s3);
        ts.add(s4);
        System.out.println(ts);
    }
}
